//
//  ViewController.m
//  jiugonge
//
//  Created by 江湖 on 2018/5/7.
//  Copyright © 2018年 江湖. All rights reserved.
//

#import "ViewController.h"
#import "ScratchableView.h"
#define KScreenW [UIScreen mainScreen].bounds.size.width
#define KScreenH [UIScreen mainScreen].bounds.size.height
@interface ViewController ()<ScratchableDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    ScratchableView *view= [[ScratchableView alloc]init];
    view.frame = CGRectMake(0, 200, KScreenW, 0);

    view.backgroundColor = [UIColor yellowColor];
    view.scratchDelegate = self;

    [self.view addSubview:view];
    [view setRow:10 cellHeight:50 totalColumns:1 totalX:10 totalY:10];
    CGFloat height = [view addScratchableLatex:0];
    view.frame = CGRectMake(0, 200, KScreenW, height);

    //    [self scratchableLatex:0];
    [view relouData];
}
-(void)scratchableWithview:(UIButton *)botton andindex:(NSInteger)row
{
    botton.backgroundColor = [UIColor redColor];
}
-(void)scratchableWithSelect:(UIButton *)botton andindex:(NSInteger)row
{
    NSLog(@"%ld",row);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
